<template>
  <div class="App">
    <h1 class="content">我是APP</h1>
    <p v-red>自定义指令</p>
    <p v-red>自定义指令2</p>
    <p v-bgColor="'blue'">自定义指令2</p>
    <p v-bgColor="'green'">自定义指令2</p>
    <Count /> 
  </div>
</template>

<script>
import Count from '@/components/Count'

export default {
  name: 'App',
  components: {
    Count
  },
  data(){
    return {
      count: 0
    }
  },
  directives:{
    red(el){
      console.log(el,"el");
      el.style.color = "red"
    },
    bgColor(el,binding){
      console.log(el,binding,"el,binding");
      el.style.background = binding.value
    }
  }
}
</script>

<style>

</style>
